Skip to content

Conversation

@mo-sameh
Copy link
Collaborator

Using the functionality introduced in peptdeep PR.
To allow finetuning a pretrained model to be able to predict different number of charged_frag_types while using the pretrained backbone as a starting point for the weights.

Copy link
Collaborator

@mschwoer mschwoer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

self._train_fraction + self._validation_fraction + self._test_fraction
<= 1.0
), "The sum of the train, validation and test fractions should be less than or equal to 1.0"
super().__init__(mask_modloss, device, self.charged_frag_types)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer calling this init still at the top..

def ...(..):
    charged_frag_types = (
            get_charged_frag_types(fragment_types, max_charge)
            if fragment_types
            else None
        )
   super().__init__(mask_modloss, device, charged_frag_types)

   self.charged_frag_types = charged_frag_types
...

I did not find a proper resource, but I feel the parent init should be called "as early as possible"
https://stackoverflow.com/a/77975817

@@ -0,0 +1,480 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A small initial description of what the purpose of this nb is would be nice

@mo-sameh mo-sameh closed this Apr 4, 2025
@mo-sameh mo-sameh deleted the transferlearning-allow-additional-fragtypes branch April 4, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants